<?php
/*
  $Id: search.php 1739 2007-12-20 00:52:16Z hpdl $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/
?>
<!-- search //-->
          <tr>
            <td>
<?php
  $info_box_contents = array();
  $info_box_contents[] = array('text' => BOX_HEADING_SEARCH);

  new infoBoxHeading($info_box_contents, false, false);
// begin Extra Product Fields
    $qfepf = '';
    if (SEARCH_ON_PTYPE == 'true') {
      $qfepf .= TEXT_PTYPE . ':<br>';
      $qfepf .= tep_draw_pull_down_menu('ptype', epf_build_ptype_pulldown(0, array(array('id' => '', 'text' => TEXT_ANY_TYPE))), '', 'style="font-size: 10px; width: ' . (BOX_WIDTH - 20) . 'px"') . '<br>';
    }
    $epf_query = tep_db_query("select e.epf_id, l.epf_label from " . TABLE_EPF . " e join " . TABLE_EPF_LABELS . " l where e.epf_status and e.epf_advanced_search and e.epf_quick_search and e.epf_uses_value_list and (!e.epf_multi_select) and (e.epf_id = l.epf_id) and (l.languages_id = " . (int)$languages_id . ") and l.epf_active_for_language order by e.epf_order");
    while ($e = tep_db_fetch_array($epf_query)) {
      $qfepf .= $e['epf_label'] . ':<br>';
      $qfepf .= tep_draw_pull_down_menu('extra_value_id' . $e['epf_id'], tep_build_epf_pulldown($e['epf_id'], $languages_id, array(array('id' => '', 'text' => TEXT_ANY_VALUE))), '', 'style="font-size: 10px; width: ' . (BOX_WIDTH - 20) . 'px"') . '<br>';
    }
/* NOTE: if you want the search to start the moment the field value is selected from the pull down
   menu then add 'onChange="this.form.submit();"' just before the word 'style' in the pull down
   functions above. */
// end Extra Product Fields
	if (QUICKSEARCH_IN_DESCRIPTION == 'true') {
		$iq_text = tep_draw_hidden_field('search_in_description','1');
	} else {
		$iq_text = '';
	}

  $info_box_contents = array();
  $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
                               'align' => 'left',
                               'text' => $iq_text . tep_draw_input_field('keywords', '', 'size="10" maxlength="60" style="width: ' . (BOX_WIDTH - 20) . 'px"') . tep_hide_session_id() . '<br>' . TEXT_CATEGORY . ':<br>' . tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES))), '', 'style="font-size: 10px; width: ' . (BOX_WIDTH - 20) . 'px"') . '<br>' . TEXT_MANUFACTURER . ':<br>' . tep_draw_pull_down_menu('manufacturers_id', tep_get_manufacturers(array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS))), '', 'style="font-size: 10px; width: ' . (BOX_WIDTH - 20) . 'px"') . '<br>' . $qfepf . tep_draw_input_field('', BOX_HEADING_SEARCH, 'alt="' . BOX_HEADING_SEARCH . '" style="font-size: 10px;"', 'submit') . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>');

  new infoBox($info_box_contents);
?>
            </td>
          </tr>
<!-- search_eof //-->
